home *** CD-ROM | disk | FTP | other *** search
- on disablePeekAlert
- global gPeekAlertEnabled
- set gPeekAlertEnabled to 0
- end
-
- on enablePeekAlert
- global gPeekAlertEnabled
- set gPeekAlertEnabled to 1
- end
-
- on clearTheStage
- global oPuppeteer
- repeat with i = 1 to 43
- puppetSprite(i, 0)
- end repeat
- updateStage()
- end
-
- on setPKscanStatus suggestion
- global oStoryteller, oPuppeteer, gScanFinish
- set validList to [#Offline, #CantAttach, #Online, #NoResidue, #Wait5min, #Wait4min, #Wait3min, #Wait2min, #Wait1min, #ReadyForPlayback, #Interrupted, #Preamble]
- if not getPos(validList, suggestion) then
- alert("Can't set #PKscanStatus to " & suggestion)
- exit
- end if
- set currentStatus to getState(oStoryteller, #PKscanStatus)
- if suggestion = #Online then
- if getPos([#Wait1min, #Wait2min, #Wait3min, #Wait4min, #Wait5min], currentStatus) then
- set gScanFinish to 0
- set suggestion to #Interrupted
- end if
- if currentStatus = #ReadyForPlayback then
- set suggestion to #ReadyForPlayback
- end if
- end if
- if suggestion = #Offline then
- set gScanFinish to 0
- end if
- if currentStatus = #ReadyForPlayback then
- if suggestion <> #ReadyForPlayback then
- setState(oStoryteller, #PeekDisplay, #none)
- end if
- if getPos([#Wait5min, #Wait4min, #Wait3min, #Wait2min, #Wait1min], suggestion) then
- setState(oStoryteller, #PeekDisplay, #goodScan5min)
- else
- end if
- end if
- setProp(the lsStateData of oStoryteller, #PKscanStatus, [suggestion])
- if (suggestion = #Interrupted) and (getState(oStoryteller, #playerHasPeekUnit) = #carrying) then
- setState(oStoryteller, #PeekDisplay, #interruptedScan)
- peekAlert()
- end if
- if the castNum of sprite 41 = getAt(getProp(the lsMultiFrames of oPuppeteer, #scanIcon), 4) then
- set the castNum of sprite 40 to getProp(getProp(the lsMultiFrames of oPuppeteer, #peekText), value("#scan" & suggestion))
- end if
- end
-
- on setPKbarStatus suggestion
- global oStoryteller, oPuppeteer
- set validList to [#Offline, #Online, #noActivity, #activityDetected]
- if not getPos(validList, suggestion) then
- alert("Can't set #PKbarStatus to " & suggestion)
- exit
- end if
- setProp(the lsStateData of oStoryteller, #PKbarStatus, [suggestion])
- if the castNum of sprite 42 = getAt(getProp(the lsMultiFrames of oPuppeteer, #barIcon), 4) then
- set the castNum of sprite 40 to getProp(getProp(the lsMultiFrames of oPuppeteer, #peekText), value("#bar" & suggestion))
- end if
- end
-
- on setPKamberStatus suggestion
- global oStoryteller, oPuppeteer
- set validList to [#Incomplete, #Online, #WaveButIncomplete, #WaveActivated, #ModulatingEEG, #oneMoment, #surfsUp]
- if not getPos(validList, suggestion) then
- alert("Can't set #PKamberStatus to " & suggestion)
- exit
- end if
- if suggestion = #Online then
- if getState(oStoryteller, #psionicWavesPresent) then
- set suggestion to #WaveActivated
- else
- set suggestion to #Online
- end if
- end if
- if suggestion = #WaveActivated then
- if getState(oStoryteller, #oscillatorInPlace) then
- set suggestion to #WaveActivated
- else
- set suggestion to #WaveButIncomplete
- end if
- end if
- setProp(the lsStateData of oStoryteller, #PKamberStatus, [suggestion])
- if the castNum of sprite 43 = getAt(getProp(the lsMultiFrames of oPuppeteer, #amberIcon), 4) then
- set the castNum of sprite 40 to getProp(getProp(the lsMultiFrames of oPuppeteer, #peekText), value("#amber" & suggestion))
- end if
- end
-
- on hideCursor
- global thisCursor, lastCursor
- set thisCursor to #noCursor
- set lastCursor to thisCursor
- cursorDance(0)
- end
-
- on resetPeeKdisplay
- global oPuppeteer, oStoryteller
- set pkScanIcon to 41
- set pkBarIcon to 42
- set pkAmberIcon to 43
- set camSprite to 44
- set peekVideo to getProp(the lsForegroundData of oPuppeteer, #PkVideoNormal)
- set the castNum of sprite camSprite to getProp(peekVideo, #PkNone)
- set scanStatus to getState(oStoryteller, #PKscanStatus)
- if (scanStatus <> #Offline) and (scanStatus <> #CantAttach) then
- set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiFrames of oPuppeteer, #scanIcon), 3)
- else
- set the castNum of sprite pkScanIcon to getAt(getProp(the lsMultiFrames of oPuppeteer, #scanIcon), 2)
- end if
- if getState(oStoryteller, #BarOnline) = 1 then
- set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiFrames of oPuppeteer, #barIcon), 3)
- else
- set the castNum of sprite pkBarIcon to getAt(getProp(the lsMultiFrames of oPuppeteer, #barIcon), 2)
- end if
- if getState(oStoryteller, #AMBERisOnline) = 1 then
- set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiFrames of oPuppeteer, #amberIcon), 3)
- else
- set the castNum of sprite pkAmberIcon to getAt(getProp(the lsMultiFrames of oPuppeteer, #amberIcon), 2)
- end if
- updateStage()
- end
-
- on buildDefaultPlaylist
- global gPeekPlayList
- set currentLoc to string(getState(oStoryteller, #currentLocation))
- set whichRoom to getLocationPointer(oPuppeteer, currentLoc, #sublist)
- set gPeekPlayList to [#PkFadeIn, #PkFadeOut]
- if whichRoom <> #office then
- addAt(gPeekPlayList, 2, #PkOffice)
- end if
- if whichRoom <> #Marg then
- addAt(gPeekPlayList, 2, #Pk40s)
- end if
- if whichRoom <> #MBR then
- addAt(gPeekPlayList, 2, #PkMBR)
- end if
- if whichRoom <> #kitchen then
- addAt(gPeekPlayList, 2, #PkKitchen)
- end if
- if whichRoom <> #diningRm then
- addAt(gPeekPlayList, 2, #PkDiningRm)
- end if
- if whichRoom <> #livingRm then
- addAt(gPeekPlayList, 2, #PkLivingRm)
- end if
- if whichRoom <> #study then
- addAt(gPeekPlayList, 2, #PkStudy)
- end if
- end
-
- on pyramidSpeaks
- global oPuppeteer, oStoryteller
- cursorOff()
- set remainingMessages to getProp(the lsStateData of oStoryteller, #pyramidMessagesRemaining)
- set messagesStack to getProp(the lsMultiFrames of oPuppeteer, #PyramidMsg)
- if count(remainingMessages) > 0 then
- set helpTest to getAt(remainingMessages, 1)
- if helpTest = #helpMe then
- set myAnswer to 6
- deleteAt(remainingMessages, 1)
- else
- set msgPosition to random(count(remainingMessages))
- set myAnswer to getAt(remainingMessages, msgPosition)
- deleteAt(remainingMessages, msgPosition)
- if count(remainingMessages) = 0 then
- append(remainingMessages, #helpMe)
- end if
- end if
- else
- set myAnswer to random(5)
- if myAnswer = 5 then
- if random(3) = 3 then
- set myAnswer to 6
- end if
- end if
- end if
- set msgSprite to #none
- repeat with i = 10 to 48
- if getPos(messagesStack, the castNum of sprite i) then
- set msgSprite to i
- exit repeat
- end if
- end repeat
- if msgSprite = #none then
- alert("pyramidSpeaks: Yikes.. Couldn't find the message-sprite")
- exit
- end if
- set the castNum of sprite msgSprite to getAt(messagesStack, myAnswer + 1)
- do("puppetTransition " & getProp(getProp(the lsMachineProfile of oPuppeteer, #transitions), #fadeIn))
- soundEffect(#pyramidGurgle)
- wait(25)
- updateStage()
- end
-